// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import MintUI from 'mint-ui'
import router from './router'
import { Swipe,SwipeItem,Search,Popup,Range,Badge,Field,Button,CellSwipe} from 'mint-ui';
import 'mint-ui/lib/style.css'
import requst from './ajaxservice'
import store  from './store'


//to.meta.isrequired&&
Vue.prototype.requst=requst
Vue.use(MintUI)
Vue.config.productionTip = false
// router.beforeEach((to,from,next)=>{
//   if(to.meta.isrequired&&store.state.user.islogin===false){
//   return  next({
//     name:'mine',
//     params:{
//     redirect:to.path  
//     }
//   })
//   }
//   else{
//     next()
//   }
// })

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: {App},
  template: '<App/>'
})
Vue.component(Swipe.name,Swipe,Badge.name,Badge,Field.name,Field,Button.name,Button,CellSwipe.name,CellSwipe);
Vue.component(SwipeItem.name, SwipeItem,Search.name, Search,Popup.name, Popup,Range.name,Range);


